from selenium import webdriver
from selenium.webdriver.common.by import By
import time



def register2(name,password,repassword):
    driver = webdriver.Chrome()

    driver.get(url="http://localhost:90/")

    driver.maximize_window()

    driver.find_element(By.XPATH,'//div[@class="login-center1"]/div[2]/a').click()

    # 注册页面链接
    time.sleep(2)

    driver.find_element(By.XPATH,'//input[@id="username"]').send_keys(name)

    driver.find_element(By.XPATH,'//input[@id="password"]').send_keys(password)

    driver.find_element(By.XPATH,'//input[@id="repassword"]').send_keys(repassword)

    driver.find_element(By.XPATH,'//button[@id="login_btn"]').click()

    time.sleep(2)

    return driver